diff --git a/system/libraries/Cart.php b/system/libraries/Cart.php
index 717ccd9..b2cc208 100644
--- a/system/libraries/Cart.php
+++ b/system/libraries/Cart.php
@@ -1,13 +1,13 @@
-<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
 /**
  * CodeIgniter
  *
  * An open source application development framework for PHP 5.1.6 or newer
  *
  * NOTICE OF LICENSE
- * 
+ *
  * Licensed under the Open Software License version 3.0
- * 
+ *
  * This source file is subject to the Open Software License (OSL 3.0) that is
  * bundled with this package in the files license.txt / license.rst.  It is
  * also available through the world wide web at this URL:
@@ -39,13 +39,13 @@
 class CI_Cart {
 
 	// These are the regular expression rules that we use to validate the product ID and product name
-	var $product_id_rules	= '\.a-z0-9_-'; // alpha-numeric, dashes, underscores, or periods
-	var $product_name_rules	= '\.\:\-_ a-z0-9'; // alpha-numeric, dashes, underscores, colons or periods
-	var $product_name_safe  = true; // only allow safe product names
+	public $product_id_rules	= '\.a-z0-9_-'; // alpha-numeric, dashes, underscores, or periods
+	public $product_name_rules	= '\.\:\-_ a-z0-9'; // alpha-numeric, dashes, underscores, colons or periods
+	public $product_name_safe  = true; // only allow safe product names
 
 	// Private variables.  Do not change!
-	var $CI;
-	var $_cart_contents	= array();
+	private $CI;
+	private $_cart_contents	= array();
 
 
 	/**
@@ -59,28 +59,17 @@
 		$this->CI =& get_instance();
 
 		// Are any config settings being passed manually?  If so, set them
-		$config = array();
-		if (count($params) > 0)
-		{
-			foreach ($params as $key => $val)
-			{
-				$config[$key] = $val;
-			}
-		}
+		$config = is_array($params) ? $params : array();
 
 		// Load the Sessions class
 		$this->CI->load->library('session', $config);
 
-		// Grab the shopping cart array from the session table, if it exists
-		if ($this->CI->session->userdata('cart_contents') !== FALSE)
-		{
-			$this->_cart_contents = $this->CI->session->userdata('cart_contents');
-		}
-		else
+		// Grab the shopping cart array from the session table
+		$this->_cart_contents = $this->CI->session->userdata('cart_contents');
+		if ($this->_cart_contents === FALSE)
 		{
 			// No cart exists so we'll set some base values
-			$this->_cart_contents['cart_total'] = 0;
-			$this->_cart_contents['total_items'] = 0;
+			$this->_cart_contents = array('cart_total' => 0, 'total_items' => 0);
 		}
 
 		log_message('debug', "Cart Class Initialized");
@@ -95,10 +84,10 @@
 	 * @param	array
 	 * @return	bool
 	 */
-	function insert($items = array())
+	public function insert($items = array())
 	{
 		// Was any cart data passed? No? Bah...
-		if ( ! is_array($items) OR count($items) == 0)
+		if ( ! is_array($items) OR count($items) === 0)
 		{
 			log_message('error', 'The insert method must be passed an array containing data.');
 			return FALSE;
@@ -132,7 +121,7 @@
 		}
 
 		// Save the cart data if the insert was successful
-		if ($save_cart == TRUE)
+		if ($save_cart === TRUE)
 		{
 			$this->_save_cart();
 			return isset($rowid) ? $rowid : TRUE;
@@ -150,10 +139,10 @@
 	 * @param	array
 	 * @return	bool
 	 */
-	function _insert($items = array())
+	private function _insert($items = array())
 	{
 		// Was any cart data passed? No? Bah...
-		if ( ! is_array($items) OR count($items) == 0)
+		if ( ! is_array($items) OR count($items) === 0)
 		{
 			log_message('error', 'The insert method must be passed an array containing data.');
 			return FALSE;
@@ -170,10 +159,8 @@
 
 		// --------------------------------------------------------------------
 
-		// Prep the quantity. It can only be a number.  Duh...
-		$items['qty'] = trim(preg_replace('/([^0-9])/i', '', $items['qty']));
-		// Trim any leading zeros
-		$items['qty'] = trim(preg_replace('/(^[0]+)/i', '', $items['qty']));
+		// Prep the quantity. It can only be a number.  Duh... also trim any leading zeros
+		$items['qty'] = ltrim(trim(preg_replace('/([^0-9])/i', '', $items['qty'])), '0');
 
 		// If the quantity is zero or blank there's nothing for us to do
 		if ( ! is_numeric($items['qty']) OR $items['qty'] == 0)
@@ -186,7 +173,7 @@
 		// Validate the product ID. It can only be alpha-numeric, dashes, underscores or periods
 		// Not totally sure we should impose this rule, but it seems prudent to standardize IDs.
 		// Note: These can be user-specified by setting the $this->product_id_rules variable.
-		if ( ! preg_match("/^[".$this->product_id_rules."]+$/i", $items['id']))
+		if ( ! preg_match('/^['.$this->product_id_rules.']+$/i', $items['id']))
 		{
 			log_message('error', 'Invalid product ID.  The product ID can only contain alpha-numeric characters, dashes, and underscores');
 			return FALSE;
@@ -196,7 +183,7 @@
 
 		// Validate the product name. It can only be alpha-numeric, dashes, underscores, colons or periods.
 		// Note: These can be user-specified by setting the $this->product_name_rules variable.
-		if ( $this->product_name_safe && ! preg_match("/^[".$this->product_name_rules."]+$/i", $items['name']))
+		if ($this->product_name_safe && ! preg_match('/^['.$this->product_name_rules.']+$/i', $items['name']))
 		{
 			log_message('error', 'An invalid name was submitted as the product name: '.$items['name'].' The name can only contain alpha-numeric characters, dashes, underscores, colons, and spaces');
 			return FALSE;
@@ -204,10 +191,8 @@
 
 		// --------------------------------------------------------------------
 
-		// Prep the price.  Remove anything that isn't a number or decimal point.
-		$items['price'] = trim(preg_replace('/([^0-9\.])/i', '', $items['price']));
-		// Trim any leading zeros
-		$items['price'] = trim(preg_replace('/(^[0]+)/i', '', $items['price']));
+		// Prep the price. Remove leading zeros and anything that isn't a number or decimal point.
+		$items['price'] = lrtrim(trim(preg_replace('/([^0-9\.])/i', '', $items['price'])), '0');
 
 		// Is the price a valid number?
 		if ( ! is_numeric($items['price']))
@@ -244,33 +229,13 @@
 
 		// Now that we have our unique "row ID", we'll add our cart items to the master array
 		// grab quantity if it's already there and add it on
-		if (isset($this->_cart_contents[$rowid]['qty']))
-		{
-			// set our old quantity
-			$old_quantity = (int)$this->_cart_contents[$rowid]['qty'];
-		}
-		else
-		{
-			// we have no old quantity but - we don't want to throw an error
-			$old_quantity = 0;
-		}
-		
-		// let's unset this first, just to make sure our index contains only the data from this submission
-		unset($this->_cart_contents[$rowid]);
+		$old_quantity = isset($this->_cart_contents[$rowid]['qty']) ? (int) $this->_cart_contents[$rowid]['qty'] : 0;
 
-		// Create a new index with our new row ID
-		$this->_cart_contents[$rowid]['rowid'] = $rowid;
+		// Re-create the entry, just to make sure our index contains only the data from this submission
+		$items['rowid'] = $rowid;
+		$items['qty'] += $old_quantity;
+		$this->_cart_contents[$rowid] = $items;
 
-		// And add the new items to the cart array
-		foreach ($items as $key => $val)
-		{
-			$this->_cart_contents[$rowid][$key] = $val;
-		}
-		
-		// add old quantity back in
-		$this->_cart_contents[$rowid]['qty'] = ($this->_cart_contents[$rowid]['qty'] + $old_quantity);
-		
-		// Woot!
 		return $rowid;
 	}
 
@@ -289,10 +254,10 @@
 	 * @param	string
 	 * @return	bool
 	 */
-	function update($items = array())
+	public function update($items = array())
 	{
 		// Was any cart data passed?
-		if ( ! is_array($items) OR count($items) == 0)
+		if ( ! is_array($items) OR count($items) === 0)
 		{
 			return FALSE;
 		}
@@ -302,9 +267,9 @@
 		// determine the array type is by looking for a required array key named "id".
 		// If it's not found we assume it's a multi-dimensional array
 		$save_cart = FALSE;
-		if (isset($items['rowid']) AND isset($items['qty']))
+		if (isset($items['rowid'], $items['qty']))
 		{
-			if ($this->_update($items) == TRUE)
+			if ($this->_update($items) === TRUE)
 			{
 				$save_cart = TRUE;
 			}
@@ -313,9 +278,9 @@
 		{
 			foreach ($items as $val)
 			{
-				if (is_array($val) AND isset($val['rowid']) AND isset($val['qty']))
+				if (is_array($val) && isset($val['rowid'], $val['qty']))
 				{
-					if ($this->_update($val) == TRUE)
+					if ($this->_update($val) === TRUE)
 					{
 						$save_cart = TRUE;
 					}
@@ -324,7 +289,7 @@
 		}
 
 		// Save the cart data if the insert was successful
-		if ($save_cart == TRUE)
+		if ($save_cart === TRUE)
 		{
 			$this->_save_cart();
 			return TRUE;
@@ -347,7 +312,7 @@
 	 * @param	array
 	 * @return	bool
 	 */
-	function _update($items = array())
+	private function _update($items = array())
 	{
 		// Without these array indexes there is nothing we can do
 		if ( ! isset($items['qty']) OR ! isset($items['rowid']) OR ! isset($this->_cart_contents[$items['rowid']]))
@@ -393,15 +358,10 @@
 	 * @access	private
 	 * @return	bool
 	 */
-	function _save_cart()
+	private function _save_cart()
 	{
-		// Unset these so our total can be calculated correctly below
-		unset($this->_cart_contents['total_items']);
-		unset($this->_cart_contents['cart_total']);
-
 		// Lets add up the individual prices and set the cart sub-total
-		$total = 0;
-		$items = 0;
+		$this->_cart_contents['total_items'] = $this->_cart_contents['cart_total'] = 0;
 		foreach ($this->_cart_contents as $key => $val)
 		{
 			// We make sure the array contains the proper indexes
@@ -410,17 +370,11 @@
 				continue;
 			}
 
-			$total += ($val['price'] * $val['qty']);
-			$items += $val['qty'];
-
-			// Set the subtotal
+			$this->_cart_contents['cart_total'] += ($val['price'] * $val['qty']);
+			$this->_cart_contents['total_items'] += $val['qty'];
 			$this->_cart_contents[$key]['subtotal'] = ($this->_cart_contents[$key]['price'] * $this->_cart_contents[$key]['qty']);
 		}
 
-		// Set the cart total and total items.
-		$this->_cart_contents['total_items'] = $items;
-		$this->_cart_contents['cart_total'] = $total;
-
 		// Is our cart empty?  If so we delete it from the session
 		if (count($this->_cart_contents) <= 2)
 		{
@@ -434,7 +388,6 @@
 		// Let's pass it to the Session class so it can be stored
 		$this->CI->session->set_userdata(array('cart_contents' => $this->_cart_contents));
 
-		// Woot!
 		return TRUE;
 	}
 
@@ -446,13 +399,13 @@
 	 * @access	public
 	 * @return	integer
 	 */
-	function total()
+	public function total()
 	{
 		return $this->_cart_contents['cart_total'];
 	}
-	
+
 	// --------------------------------------------------------------------
-	
+
 	/**
 	 * Remove Item
 	 *
@@ -463,16 +416,12 @@
 	 */
 	 public function remove($rowid)
 	 {
-		// just do an unset 
+		// unset & save
 		unset($this->_cart_contents[$rowid]);
-		
-		// we need to save the cart now we've made our changes
 		$this->_save_cart();
-		
-		// completed
-		return true;
+		return TRUE;
 	 }
-	 
+
 	// --------------------------------------------------------------------
 
 	/**
@@ -483,7 +432,7 @@
 	 * @access	public
 	 * @return	integer
 	 */
-	function total_items()
+	public function total_items()
 	{
 		return $this->_cart_contents['total_items'];
 	}
@@ -498,19 +447,10 @@
 	 * @access	public
 	 * @return	array
 	 */
-	function contents($newest_first = false)
+	public function contents($newest_first = FALSE)
 	{
 		// do we want the newest first?
-		if($newest_first)
-		{
-			// reverse the array
-			$cart = array_reverse($this->_cart_contents);
-		}
-		else
-		{
-			// just added first to last
-			$cart = $this->_cast_contents;
-		}
+		$cart = ($newest_first) ? array_reverse($this->_cart_contents) : $this->_cart_contents;
 
 		// Remove these so they don't create a problem when showing the cart table
 		unset($cart['total_items']);
@@ -528,16 +468,11 @@
 	 * that has options associated with it.
 	 *
 	 * @access	public
-	 * @return	array
+	 * @return	bool
 	 */
-	function has_options($rowid = '')
+	public function has_options($rowid = '')
 	{
-		if ( ! isset($this->_cart_contents[$rowid]['options']) OR count($this->_cart_contents[$rowid]['options']) === 0)
-		{
-			return FALSE;
-		}
-
-		return TRUE;
+		return (isset($this->_cart_contents[$rowid]['options']) && count($this->_cart_contents[$rowid]['options']) !== 0) ? TRUE : FALSE;
 	}
 
 	// --------------------------------------------------------------------
@@ -550,14 +485,9 @@
 	 * @access	public
 	 * @return	array
 	 */
-	function product_options($rowid = '')
+	public function product_options($rowid = '')
 	{
-		if ( ! isset($this->_cart_contents[$rowid]['options']))
-		{
-			return array();
-		}
-
-		return $this->_cart_contents[$rowid]['options'];
+		return isset($this->_cart_contents[$rowid]['options']) ? $this->_cart_contents[$rowid]['options'] : array();
 	}
 
 	// --------------------------------------------------------------------
@@ -568,9 +498,9 @@
 	 * Returns the supplied number with commas and a decimal point.
 	 *
 	 * @access	public
-	 * @return	integer
+	 * @return	string
 	 */
-	function format_number($n = '')
+	public function format_number($n = '')
 	{
 		if ($n == '')
 		{
@@ -591,15 +521,11 @@
 	 * Empties the cart and kills the session
 	 *
 	 * @access	public
-	 * @return	null
+	 * @return	void
 	 */
-	function destroy()
+	public function destroy()
 	{
-		unset($this->_cart_contents);
-
-		$this->_cart_contents['cart_total'] = 0;
-		$this->_cart_contents['total_items'] = 0;
-
+		$this->_cart_contents = array('cart_total' => 0, 'total_items' => 0);
 		$this->CI->session->unset_userdata('cart_contents');
 	}
 
@@ -608,4 +534,4 @@
 // END Cart Class
 
 /* End of file Cart.php */
-/* Location: ./system/libraries/Cart.php */
\ No newline at end of file
+/* Location: ./system/libraries/Cart.php */
